<template>
  <el-main>
    <el-row type="flex" align="middle" :gutter="20" justify="start">
      <el-col>
        <slot name="inputSlot" v-bind:text="text"></slot>
      </el-col>
      <el-col :span="4">
        <!-- 定义默认一个插槽 -->
        <slot :tip="tip"></slot>
      </el-col>
      <el-col>
        <slot name="btnSlot" :sendMessage="sendMessage"></slot>
      </el-col>
    </el-row>
  </el-main>
</template>

<script>

export default {
  name: 'DEMOMessageInput',
  data() {
    return {
      text: 'aaa',
      tip: '请输入留言信息'
    };
  },

  mounted() {

  },

  methods: {
    sendMessage() {
      console.log(this.text);
      this.$emit('mysend', this.text)
    }
  },
}
</script>

<style lang="less" scoped></style>